//节流函数
const useThrottle = () => {
    let timeout: number
    return (callback: () => any, wait = 100) => {
        if (timeout) {
            clearTimeout(timeout)
        }
        timeout = setTimeout(() => {
            callback()
            clearTimeout(timeout)
        }, wait)
    }
}
export default useThrottle;
